package cn.iocoder.yudao.module.blog.dal.mysql.component;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.component.BlogComponentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.component.vo.*;

/**
 * 置顶案例 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogComponentMapper extends BaseMapperX<BlogComponentDO> {

    default PageResult<BlogComponentDO> selectPage(BlogComponentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogComponentDO>()
                .betweenIfPresent(BlogComponentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogComponentDO::getId));
    }

    default List<BlogComponentDO> selectList(BlogComponentExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogComponentDO>()
                .betweenIfPresent(BlogComponentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogComponentDO::getId));
    }

}
